
$("#datepicker").datepicker();
$('#datepicker').datepicker('option', {dateFormat: "yy-mm-dd"});
function examAdd_clicked()
{
	var courseName=$('#courseName').val();
	var examName=$('#examName').val();
	$.ajax({
            type: 'Post',
            url: '/addexam_action_add',
            data: "courseName="+courseName+"&examName="+examName,
            success: function(response) {
                resolveMessage(response);
            }
        })
}
function resolveMessage(msg)
{
	$('#examName').val("");
	if(msg=='failed')
	 alert('系统原因，添加失败。')
	else if(msg=='add succeed')
	 alert('添加成功！')
	else if(msg=='same exam')
	 alert('当前考试名字已经存在，添加失败！')
}